﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using POS.BusinessComponents;
using POS.BusinessEntities;
using POS.DataObjects;
using Rhino.Mocks;

namespace POS.BusinessComponentsTest
{
    [TestClass]
    public class BCArticuloTest
    {
        #region Declarations

        private readonly MockRepository mocks = new MockRepository();
        private const int EmpresaId = 1;

        #endregion

        #region Test Methods

        [TestMethod]
        public void GetArticuloList()
        {
            var dummyFilter = "dummy";
            var searchBy = SearchField.Name;
            var doMock = (DOArticulo)mocks.StrictMock(typeof(DOArticulo));
            var expected = new List<BEArticuloBusqueda>();

            Expect.Call(doMock.GetList(EmpresaId, dummyFilter, searchBy)).Return(expected).Repeat.Once();

            doMock.Replay();
            new BCArticulo(doMock).GetList(dummyFilter, searchBy);
            doMock.VerifyAllExpectations();
        }
        
        #endregion
    }
}
